package com.bawei.property.entity

import com.bawei.network.BaseResponse
import com.blankj.utilcode.util.GsonUtils
import org.json.JSONArray

data class CarColorResultEntity(
    val msg: String,
    val statuesCode: String,
    val values: String,
): BaseResponse(){
    fun getValues(): List<CarColorValues> {
        var list: MutableList<CarColorValues> = mutableListOf()
        var jsonArr = JSONArray(values)
        for (i in 0 until jsonArr.length()) {
            list.add(GsonUtils.fromJson(jsonArr[i].toString(), CarColorValues::class.java))
        }
        return list
    }
}

data class CarColorValues(
    val colorId: Int,
    val colorValue: String,
)
